package com.hirsi.module.role.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;

import com.hirsi.core.expand.TableRUpdate;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 角色菜单中间表
 * </p>
 *
 * @author Hirsi
 * @since 2024-03-12
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("h_r_role_menu")
public class RRoleMenu extends Model<RRoleMenu> implements TableRUpdate {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 角色id
     */
    @TableField("role_id")
    private Integer roleId;

    /**
     * 菜单id
     */
    @TableField("menu_id")
    private Integer menuId;

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public Object getEqualsField() {
        return menuId;
    }

    @Override
    public void setEqualsField(Object equalsField) {
        menuId = (Integer) equalsField;
    }
}
